from bs4 import BeautifulSoup as bs

html_doc = None
with open("baidu_test.html",encoding="utf-8") as f:
    html_doc = f.read()
    f.close()

soup = bs(html_doc,'lxml')
# print(soup)
print(type(soup))
title = soup.select('title ')
# 更为简单的方法
title1 = soup.title.text
print(title)
print(title1)

